<template>
    <div class="home">
        <img alt="Vue logo" src="../assets/logo.png">
        <p>站点列表</p>
        <!-- <HelloWorld msg="Welcome to Your Vue.js + TypeScript App" /> -->
        <p v-for="item in aaa" :key="item.stationCode">{{ item.stationName }}</p>
    </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import HelloWorld from "@/components/HelloWorld.vue"; // @ is an alias to /src
import axios from "axios";

@Component({
    components: {
        HelloWorld
    }
})
export default class Home extends Vue {
    private aaa: boolean = false;
    // 计算属性
    private clickMe() {
        axios
            .get("http://192.168.21.142:17001/baseInfoApi/api/v1/baseInfo/station/findAllUsableForApi")
            .then(data => {
                this.aaa = data.data.result.stationApiReturnDTOs;
                console.log(this.aaa);
            })
            .catch(err => {
                console.log(err);
            });
    }
    // life cycle
    private mounted() {
        console.log(typeof this.aaa);
        this.clickMe();
    }
}
</script>
